From bb8aec3fa557cda9e0c7483ac0d8ef2ef839b23a Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 18 Mar 2005 03:56:36 +0000 Subject: [PATCH] Billions of warning fixes for MSVC-like substances. From Andrew Kirmse (akirmse at google's mail) and to a lesser degree, myself. --- gpsbabel/Makefile | 16 ++++--- gpsbabel/cetus.c | 12 ++--- gpsbabel/coastexp.c | 1 - gpsbabel/coldsync/pdb.c | 32 +++++++------ gpsbabel/coldsync/util.c | 16 +++---- gpsbabel/copilot.c | 2 +- gpsbabel/csv_util.c | 11 +++-- gpsbabel/defs.h | 12 +++-- gpsbabel/delgpl.c | 1 - gpsbabel/easygps.c | 2 +- gpsbabel/garmin.c | 6 +-- gpsbabel/gcdb.c | 2 +- gpsbabel/geoniche.c | 2 +- gpsbabel/glogbook.c | 5 +- gpsbabel/gpilots.c | 2 +- gpsbabel/gpspilot.c | 2 +- gpsbabel/gpx.c | 5 +- gpsbabel/html.c | 4 +- gpsbabel/igc.c | 6 +-- gpsbabel/jeeps/gps.h | 2 - gpsbabel/jeeps/gpsapp.c | 88 ++++++++++++++++------------------- gpsbabel/jeeps/gpscom.c | 4 +- gpsbabel/jeeps/gpscom.h | 4 +- gpsbabel/jeeps/gpsprot.h | 2 +- gpsbabel/jeeps/gpsread.c | 1 + gpsbabel/jeeps/gpsread.h | 1 + gpsbabel/jeeps/gpssend.c | 5 +- gpsbabel/jeeps/gpsserial.c | 3 +- gpsbabel/jeeps/gpsserial.h | 1 + gpsbabel/jeeps/gpsusbread.c | 3 +- gpsbabel/jeeps/gpsusbsend.c | 5 +- gpsbabel/jeeps/gpsusbwin.c | 13 +++--- gpsbabel/kml.c | 1 - gpsbabel/magnav.c | 4 +- gpsbabel/magproto.c | 2 +- gpsbabel/mapopolis.c | 4 +- gpsbabel/mapsend.c | 2 +- gpsbabel/mapsource.c | 15 ++---- gpsbabel/msvc/GPSBabel.dsp | 5 +- gpsbabel/msvc/GPSBabel.vcproj | 5 +- gpsbabel/nmea.c | 2 +- gpsbabel/palmdoc.c | 9 ++-- gpsbabel/position.c | 2 +- gpsbabel/psitrex.c | 18 +------ gpsbabel/quovadis.c | 10 ++-- gpsbabel/shape.c | 2 - gpsbabel/stackfilter.c | 1 - gpsbabel/text.c | 4 +- gpsbabel/tools/mkchanges | 1 + gpsbabel/util.c | 3 -- gpsbabel/uuid.c | 12 +---- gpsbabel/vcf.c | 9 +--- 52 files changed, 179 insertions(+), 203 deletions(-) diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index 6c8849f59..21e4b5111 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -158,7 +158,7 @@ gpilots.o: gpilots.c defs.h queue.h gbtypes.h coldsync/palm.h \ gpspilot.o: gpspilot.c defs.h queue.h gbtypes.h coldsync/palm.h \ coldsync/pdb.h gpsutil.o: gpsutil.c defs.h queue.h gbtypes.h magellan.h -gpx.o: gpx.c defs.h queue.h gbtypes.h +gpx.o: gpx.c defs.h queue.h gbtypes.h xmlgeneric.h grtcirc.o: grtcirc.c defs.h queue.h gbtypes.h hiketech.o: hiketech.c defs.h queue.h gbtypes.h xmlgeneric.h holux.o: holux.c defs.h queue.h gbtypes.h holux.h @@ -170,6 +170,7 @@ html.o: html.c defs.h queue.h gbtypes.h jeeps/gpsmath.h jeeps/gps.h \ jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h igc.o: igc.c defs.h queue.h gbtypes.h internal_styles.o: internal_styles.c defs.h queue.h gbtypes.h +kml.o: kml.c defs.h queue.h gbtypes.h xmlgeneric.h lowranceusr.o: lowranceusr.c defs.h queue.h gbtypes.h magnav.o: magnav.c defs.h queue.h gbtypes.h coldsync/palm.h \ coldsync/pdb.h @@ -274,7 +275,7 @@ jeeps/gpsread.o: jeeps/gpsread.c jeeps/gps.h defs.h queue.h gbtypes.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \ jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \ - jeeps/gpsnmeaget.h + jeeps/gpsnmeaget.h jeeps/gpsusbint.h jeeps/gpsrqst.o: jeeps/gpsrqst.c jeeps/gps.h defs.h queue.h gbtypes.h \ jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ @@ -286,25 +287,27 @@ jeeps/gpssend.o: jeeps/gpssend.c jeeps/gps.h defs.h queue.h gbtypes.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \ jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \ - jeeps/gpsnmeaget.h + jeeps/gpsnmeaget.h jeeps/gpsusbint.h jeeps/gpsserial.o: jeeps/gpsserial.c jeeps/gps.h defs.h queue.h gbtypes.h \ jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \ jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \ - jeeps/gpsnmeaget.h + jeeps/gpsnmeaget.h jeeps/garminusb.h jeeps/gpsusbread.o: jeeps/gpsusbread.c jeeps/gps.h defs.h queue.h \ gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \ jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \ jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \ jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \ - jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h + jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \ + jeeps/gpsusbint.h jeeps/gpsusbsend.o: jeeps/gpsusbsend.c jeeps/gps.h defs.h queue.h \ gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \ jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \ jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \ jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \ - jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h + jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \ + jeeps/gpsusbint.h jeeps/gpsusbstub.o: jeeps/gpsusbstub.c jeeps/gpsutil.o: jeeps/gpsutil.c jeeps/gps.h defs.h queue.h gbtypes.h \ jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \ @@ -316,3 +319,4 @@ shapelib/dbfopen.o: shapelib/dbfopen.c shapelib/shapefil.h shapelib/shpopen.o: shapelib/shpopen.c shapelib/shapefil.h internal_styles.c: mkstyle.sh style/README.style style/arc.style style/csv.style style/custom.style style/dna.style style/fugawi.style style/gpsdrive.style style/gpsman.style style/mapconverter.style style/mxf.style style/nima.style style/s_and_t.style style/saplus.style style/tabsep.style style/xmap.style style/xmapwpt.style ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1) + ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1) diff --git a/gpsbabel/cetus.c b/gpsbabel/cetus.c index f46cc2b07..2e462fff2 100644 --- a/gpsbabel/cetus.c +++ b/gpsbabel/cetus.c @@ -60,7 +60,7 @@ struct record { unsigned char sec; /* accuracy and precision information for use where applicable */ - char sat; /* ff if averaged or unknown */ + unsigned char sat; /* ff if averaged or unknown */ pdb_16 pdop; /* pdop * 100 */ pdb_16 hdop; pdb_16 vdop; @@ -238,13 +238,13 @@ cetus_writewpt(const waypoint *wpt) be_write16(&rec->year, 0xff); } - be_write32(&rec->longitude, wpt->longitude * 10000000.0); - be_write32(&rec->latitude, wpt->latitude * 10000000.0); + be_write32(&rec->longitude, (unsigned int) (wpt->longitude * 10000000.0)); + be_write32(&rec->latitude, (unsigned int) (wpt->latitude * 10000000.0)); if ( wpt->altitude == unknown_alt ) { - be_write32(&rec->elevation, -100000000U); + be_write32(&rec->elevation, -100000000); } else { - be_write32(&rec->elevation, wpt->altitude * 100.0); + be_write32(&rec->elevation, (unsigned int) (wpt->altitude * 100.0)); } be_write16( &rec->pdop, 0xffff ); @@ -327,7 +327,7 @@ cetus_writewpt(const waypoint *wpt) } vdata += strlen( vdata ) + 1; - opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec); + opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/coastexp.c b/gpsbabel/coastexp.c index e262285df..985208950 100755 --- a/gpsbabel/coastexp.c +++ b/gpsbabel/coastexp.c @@ -605,7 +605,6 @@ ce_write(void) the standalone waypoints. */ time_t now = 0; - int short_length; now = current_time(); write_xml_header(ofd); diff --git a/gpsbabel/coldsync/pdb.c b/gpsbabel/coldsync/pdb.c index a19e3fe02..d3c549128 100644 --- a/gpsbabel/coldsync/pdb.c +++ b/gpsbabel/coldsync/pdb.c @@ -6,7 +6,7 @@ * You may distribute this file under the terms of the Artistic * License, as specified in the README file. * - * $Id: pdb.c,v 1.6 2004-04-16 16:47:51 parkrrrr Exp $ + * $Id: pdb.c,v 1.7 2005-03-18 03:56:35 robertl Exp $ */ /* XXX - The way zero-length records are handled is a bit of a kludge. They * shouldn't normally exist, with the exception of expunged records. But, @@ -33,7 +33,9 @@ * but doesn't have it prototyped. Systems with 64-bit file I/O but * based on LP64 model (i.e. OS/X) _require_ the prototype for lseek. */ -#if !defined (__WIN32__) +#if defined (__WIN32__) +#include +#else #include #endif #include @@ -434,7 +436,7 @@ pdb_Write(const struct pdb *db, wptr = header_buf; memcpy(wptr, db->name, PDB_DBNAMELEN); wptr += PDB_DBNAMELEN; - put_uword(&wptr, (db->attributes & ~PDB_ATTR_OPEN)); + put_uword(&wptr, (uword) (db->attributes & ~PDB_ATTR_OPEN)); /* Clear the 'open' flag before writing */ put_uword(&wptr, db->version); put_udword(&wptr, db->ctime); @@ -1200,7 +1202,7 @@ get_file_length(int fd) /* And return to where we were before */ lseek(fd, here, SEEK_SET); - return eof - here; + return (uword) (eof - here); } /* pdb_LoadHeader @@ -1519,9 +1521,9 @@ pdb_LoadAppBlock(int fd, struct pdb *db) { int err; - localID next_off; /* Offset of the next thing in the file + udword next_off; /* Offset of the next thing in the file * after the AppInfo block */ - off_t offset; /* Offset into file, for checking */ + udword offset; /* Offset into file, for checking */ /* Check to see if there even *is* an AppInfo block */ if (db->appinfo_offset == 0L) @@ -1582,7 +1584,7 @@ pdb_LoadAppBlock(int fd, * we've already passed the beginning of the AppInfo block, as * given by its offset in the header. */ - offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ + offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ if (offset != db->appinfo_offset) { if (offset > db->appinfo_offset) @@ -1638,7 +1640,7 @@ pdb_LoadSortBlock(int fd, int err; localID next_off; /* Offset of the next thing in the file * after the sort block */ - off_t offset; /* Offset into file, for checking */ + localID offset; /* Offset into file, for checking */ /* Check to see if there even *is* a sort block */ if (db->sortinfo_offset == 0L) @@ -1695,7 +1697,7 @@ pdb_LoadSortBlock(int fd, * we've already passed the beginning of the sort block, as given * by its offset in the header. */ - offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ + offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ if (offset != db->sortinfo_offset) { if (offset > db->sortinfo_offset) @@ -1755,7 +1757,7 @@ pdb_LoadResources(int fd, i < db->numrecs; i++, rsrc = rsrc->next) { - off_t offset; /* Current offset, for checking */ + udword offset; /* Current offset, for checking */ udword next_off; /* Offset of next resource in file */ /* Sanity check: make sure we haven't stepped off the end @@ -1785,7 +1787,7 @@ pdb_LoadResources(int fd, * whether we've already passed the beginning of the * resource, as given by its offset in the resource index. */ - offset = lseek(fd, 0L, SEEK_CUR); + offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are now */ if (offset != rsrc->offset) { @@ -1843,7 +1845,7 @@ pdb_LoadResources(int fd, /* Subtract this resource's index from that of the next * thing, to get the size of this resource. */ - rsrc->data_len = next_off - rsrc->offset; + rsrc->data_len = (uword) (next_off - rsrc->offset); /* Allocate space for this resource */ if ((rsrc->data = (ubyte *) malloc(rsrc->data_len)) == NULL) @@ -1893,7 +1895,7 @@ pdb_LoadRecords(int fd, i < db->numrecs; i++, rec = rec->next) { - off_t offset; /* Current offset, for checking */ + udword offset; /* Current offset, for checking */ localID next_off; /* Offset of next resource in file */ /* Sanity check: make sure we haven't stepped off the end @@ -1918,7 +1920,7 @@ pdb_LoadRecords(int fd, * whether we've already passed the beginning of the * record, as given by its offset in the record index. */ - offset = lseek(fd, 0L, SEEK_CUR); + offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are now */ if (offset != rec->offset) { @@ -1975,7 +1977,7 @@ pdb_LoadRecords(int fd, /* Subtract this record's index from that of the next one, * to get the size of this record. */ - rec->data_len = next_off - rec->offset; + rec->data_len = (uword) (next_off - rec->offset); /* Allocate space for this record * If there's a record with length zero, don't pass that to diff --git a/gpsbabel/coldsync/util.c b/gpsbabel/coldsync/util.c index 81b6ffd1d..2d7031d3c 100644 --- a/gpsbabel/coldsync/util.c +++ b/gpsbabel/coldsync/util.c @@ -12,7 +12,7 @@ * native format, convert them to Palm (big-endian) format, and write * them to a ubyte string. * - * $Id: util.c,v 1.3 2004-01-18 01:24:41 robertl Exp $ + * $Id: util.c,v 1.4 2005-03-18 03:56:35 robertl Exp $ */ #include "config.h" @@ -65,7 +65,7 @@ get_ubyte(const ubyte **buf) } INLINE void -put_ubyte(ubyte **buf, ubyte value) +put_ubyte(ubyte **buf, const ubyte value) { **buf = value; ++(*buf); @@ -83,7 +83,7 @@ get_uword(const ubyte **buf) } INLINE void -put_uword(ubyte **buf, uword value) +put_uword(ubyte **buf, const uword value) { **buf = (value >> 8) & 0xff; ++(*buf); @@ -103,15 +103,15 @@ get_udword(const ubyte **buf) } INLINE void -put_udword(ubyte **buf, udword value) +put_udword(ubyte **buf, const udword value) { - **buf = (value >> 24) & 0xff; + **buf = (ubyte) ((value >> 24) & 0xff); ++(*buf); - **buf = (value >> 16) & 0xff; + **buf = (ubyte) ((value >> 16) & 0xff); ++(*buf); - **buf = (value >> 8) & 0xff; + **buf = (ubyte) ((value >> 8) & 0xff); ++(*buf); - **buf = value & 0xff; + **buf = (ubyte) (value & 0xff); ++(*buf); } #if TIME diff --git a/gpsbabel/copilot.c b/gpsbabel/copilot.c index abb9bb0fc..d55adb62f 100644 --- a/gpsbabel/copilot.c +++ b/gpsbabel/copilot.c @@ -158,7 +158,7 @@ copilot_writewpt(const waypoint *wpt) } vdata += strlen( vdata ) + 1; - opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec); + opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/csv_util.c b/gpsbabel/csv_util.c index 61d2d978f..091bc9789 100644 --- a/gpsbabel/csv_util.c +++ b/gpsbabel/csv_util.c @@ -39,6 +39,11 @@ extern char *xcsv_urlbase; extern char *prefer_shortnames; +extern const char *gs_get_container(geocache_container t); +extern geocache_container gs_mktype(const char *t); +extern geocache_container gs_mkcont(const char *t); +extern const char *gs_get_cachetype(geocache_type t); + static double pathdist = 0; static double oldlon = 999; static double oldlat = 999; @@ -649,7 +654,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp) } else if (strcmp(fmp->key, "LAT_INT32DEG") == 0) { /* latitude as a 32 bit integer offset */ - wpt->latitude = intdeg_to_dec(atof(s), 1); + wpt->latitude = intdeg_to_dec((int) atof(s), 1); } else if ( strcmp(fmp->key, "LAT_HUMAN_READABLE") == 0) { human_to_dec( s, &wpt->latitude, &wpt->longitude, 1 ); @@ -669,7 +674,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp) } else if (strcmp(fmp->key, "LON_INT32DEG") == 0) { /* longitude as a 32 bit integer offset */ - wpt->longitude = intdeg_to_dec(atof(s), 0); + wpt->longitude = intdeg_to_dec((int) atof(s), 0); } else if ( strcmp(fmp->key, "LON_HUMAN_READABLE") == 0) { human_to_dec( s, &wpt->latitude, &wpt->longitude, 2 ); @@ -812,7 +817,7 @@ xcsv_data_read(void) } static void -xcsv_resetpathlen() +xcsv_resetpathlen(const route_head *head) { pathdist = 0; oldlat = 999; diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 7afd45e80..93eaa0c19 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -45,6 +45,11 @@ # define snprintf _snprintf #endif +/* Turn off numeric conversion warning */ +#if __WIN32__ +#pragma warning(disable:4244) +#endif + /* * Common definitions. There should be no protocol or file-specific * data in this file. @@ -424,6 +429,7 @@ typedef struct filter_vecs { void waypt_init(void); void route_init(void); void waypt_disp(const waypoint *); +void waypt_status_disp(int total_ct, int myct); void fatal(const char *, ...) #if __GNUC__ __attribute__ ((__format__ (__printf__, 1, 2))) @@ -434,13 +440,13 @@ void warning(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))) #endif ; -ff_vecs_t *find_vec(char *, char **); +ff_vecs_t *find_vec(char * const, char **); void disp_vecs(void); void exit_vecs(void); void disp_formats(int version); -void printposn(double c, int is_lat); +void printposn(const double c, int is_lat); -filter_vecs_t * find_filter_vec(char *, char **); +filter_vecs_t * find_filter_vec(char * const, char **); void free_filter_vec(filter_vecs_t *); void disp_filters(int version); void disp_filter_vecs(void); diff --git a/gpsbabel/delgpl.c b/gpsbabel/delgpl.c index 22c34b0fd..3e65936bf 100644 --- a/gpsbabel/delgpl.c +++ b/gpsbabel/delgpl.c @@ -56,7 +56,6 @@ gpl_read(void) { waypoint *wpt_tmp; route_head *track_head; - int br; gpl_point_t gp; double alt_feet; diff --git a/gpsbabel/easygps.c b/gpsbabel/easygps.c index b64373b1e..bcfab3f03 100644 --- a/gpsbabel/easygps.c +++ b/gpsbabel/easygps.c @@ -25,7 +25,7 @@ static FILE *file_in; static FILE *file_out; static void *mkshort_handle; -static char *deficon = NULL; +/* static char *deficon = NULL; */ #define MYNAME "EasyGPS" diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index 9c4334087..259709a71 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -168,6 +168,7 @@ waypt_read_cb(int total_ct, GPS_PWay *way) i++; waypt_status_disp(total_ct, i); } + return 0; } static void @@ -389,7 +390,7 @@ sane_GPS_Way_New(void) way->addr[0] = 0; way->cross_road[0] = 0; way->cross_road[0] = 0; - way->dpth = 1.0e25; + way->dpth = 1.0e25f; way->wpt_class = 0; return way; @@ -433,7 +434,6 @@ waypoint_write(void) queue *elem, *tmp; extern queue waypt_head; GPS_PWay *way; - extern int32 gps_save_id; int icon; way = xcalloc(n,sizeof(*way)); @@ -639,7 +639,7 @@ track_write(void) } static void -data_write() +data_write(void) { if (poweroff) { return; diff --git a/gpsbabel/gcdb.c b/gpsbabel/gcdb.c index a67230628..8f9727736 100644 --- a/gpsbabel/gcdb.c +++ b/gpsbabel/gcdb.c @@ -293,7 +293,7 @@ gcdb_write_wpt(const waypoint *wpt) */ reclen = gcdb_add_to_rec(rec, NULL, 0, NULL); - opdb_rec = new_Record(0, 2, ct++, reclen, (const ubyte *)rec); + opdb_rec = new_Record(0, 2, ct++, (uword) reclen, (const ubyte *)rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/geoniche.c b/gpsbabel/geoniche.c index c73ca8dbb..69e22e8ca 100644 --- a/gpsbabel/geoniche.c +++ b/gpsbabel/geoniche.c @@ -484,7 +484,7 @@ copilot_writewpt(const waypoint *wpt) fatal(MYNAME ": libpdb couldn't get record memory\n"); } - opdb_rec = new_Record (0, 0, ct++, vlen+1, vdata); + opdb_rec = new_Record (0, 0, ct++, (uword) (vlen+1), vdata); if (opdb_rec == NULL) fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/glogbook.c b/gpsbabel/glogbook.c index 8a99914b0..3fe98162d 100644 --- a/gpsbabel/glogbook.c +++ b/gpsbabel/glogbook.c @@ -36,7 +36,7 @@ arglist_t glogbook_args[] = { /* Tracks */ static xg_callback gl_trk_s; -static xg_callback gl_trk_ident; +// static xg_callback gl_trk_ident; static xg_callback gl_trk_pnt_s, gl_trk_pnt_e; static xg_callback gl_trk_utc; static xg_callback gl_trk_lat; @@ -126,11 +126,12 @@ void gl_trk_s(const char *args, const char **unused) trk_head = route_head_alloc(); track_add_head(trk_head); } - +#if 0 void gl_trk_ident(const char *args, const char **unused) { trk_head->rte_name = xstrdup(args); } +#endif void gl_trk_pnt_s(const char *args, const char **unused) { diff --git a/gpsbabel/gpilots.c b/gpsbabel/gpilots.c index bf1dda40c..24cd5e606 100644 --- a/gpsbabel/gpilots.c +++ b/gpsbabel/gpilots.c @@ -405,7 +405,7 @@ my_write_wpt(const waypoint *wpt) le_write32(&rec->wpt.d103.lat, lat); le_write32(&rec->wpt.d103.lon, lon); - opdb_rec = new_Record(0, 0, ct++, vdata - (char *) rec, (const ubyte *) rec); + opdb_rec = new_Record(0, 0, ct++, (uword) (vdata - (char *) rec), (const ubyte *) rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/gpspilot.c b/gpsbabel/gpspilot.c index 2c74f9966..4bc707798 100644 --- a/gpsbabel/gpspilot.c +++ b/gpsbabel/gpspilot.c @@ -207,7 +207,7 @@ gpspilot_writewpt(const waypoint *wpt) } vdata += strlen( vdata ) + 1; - opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec); + opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index fd6a93a1d..78f6590d7 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -495,7 +495,7 @@ gs_container_mapping{ }; geocache_type -gs_mktype(char *t) +gs_mktype(const char *t) { int i; int sz = sizeof(gs_type_map) / sizeof(gs_type_map[0]); @@ -523,7 +523,7 @@ gs_get_cachetype(geocache_type t) } geocache_container -gs_mkcont(char *t) +gs_mkcont(const char *t) { int i; int sz = sizeof(gs_container_map) / sizeof(gs_container_map[0]); @@ -1117,7 +1117,6 @@ write_gpx_url(const waypoint *waypointp) static void gpx_waypt_pr(const waypoint *waypointp) { - char *tmp_ent; const char *oname; char *odesc; diff --git a/gpsbabel/html.c b/gpsbabel/html.c index aad90cfce..1e224fc03 100644 --- a/gpsbabel/html.c +++ b/gpsbabel/html.c @@ -70,8 +70,8 @@ html_disp(const waypoint *wpt) double utme, utmn; char utmzc; - lonint = abs(wpt->longitude); - latint = abs(wpt->latitude); + lonint = abs((int) wpt->longitude); + latint = abs((int) wpt->latitude); GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, &utme, &utmn, &utmz, &utmzc); diff --git a/gpsbabel/igc.c b/gpsbabel/igc.c index ceaeae8cd..37f98cee8 100644 --- a/gpsbabel/igc.c +++ b/gpsbabel/igc.c @@ -842,20 +842,20 @@ static void wr_track(void) QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) { wpt = (waypoint *) elem; pres_alt = interpolate_alt(pres_track, wpt->creation_time + time_adj); - wr_fix_record(wpt, pres_alt, wpt->altitude); + wr_fix_record(wpt, (int) pres_alt, (int) wpt->altitude); } } else { if (pres_track) { // Only the pressure altitude track was found so generate fix // records from it alone. QUEUE_FOR_EACH(&pres_track->waypoint_list, elem, tmp) { - wr_fix_record((waypoint *) elem, ((waypoint *) elem)->altitude, unknown_alt); + wr_fix_record((waypoint *) elem, (int) ((waypoint *) elem)->altitude, (int) unknown_alt); } } else if (gnss_track) { // Only the GNSS altitude track was found so generate fix // records from it alone. QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) { - wr_fix_record((waypoint *) elem, unknown_alt, ((waypoint *) elem)->altitude); + wr_fix_record((waypoint *) elem, (int) unknown_alt, (int) ((waypoint *) elem)->altitude); } } else { // No tracks found so nothing to do diff --git a/gpsbabel/jeeps/gps.h b/gpsbabel/jeeps/gps.h index 686a81398..69dba75aa 100644 --- a/gpsbabel/jeeps/gps.h +++ b/gpsbabel/jeeps/gps.h @@ -182,7 +182,6 @@ extern double gps_save_version; extern char gps_save_string[GPS_ARB_LEN]; extern int gps_is_usb; - extern struct COMMANDDATA COMMAND_ID[2]; extern struct LINKDATA LINK_ID[3]; extern struct GPS_MODEL_PROTOCOL GPS_MP[]; @@ -193,7 +192,6 @@ extern char *gps_aviation_sym[]; extern char *gps_16_sym[]; - #endif #ifdef __cplusplus diff --git a/gpsbabel/jeeps/gpsapp.c b/gpsbabel/jeeps/gpsapp.c index e58ca1a8a..4e237a08b 100644 --- a/gpsbabel/jeeps/gpsapp.c +++ b/gpsbabel/jeeps/gpsapp.c @@ -26,6 +26,7 @@ #include #include #include +#include #define XMIN(a,b) (a < b? a : b) @@ -616,7 +617,7 @@ static void GPS_A001(GPS_PPacket packet) ** ** @return [int32] number of waypoint entries ************************************************************************/ -int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)()) +int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)(int, GPS_PWay *)) { static UC data[2]; int32 fd; @@ -770,7 +771,7 @@ int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)()) ** ** @return [int32] success ************************************************************************/ -int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)()) +int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)(GPS_PWay *)) { UC data[GPS_ARB_LEN]; int32 fd; @@ -785,7 +786,7 @@ int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)()) if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New())) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data, (short) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -800,7 +801,7 @@ int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)()) for(i=0;ialt = GPS_Util_Get_Float(p); p+=sizeof(float); - (*way)->dpth = (int32)GPS_Util_Get_Float(p); + (*way)->dpth = GPS_Util_Get_Float(p); p+=sizeof(float); - (*way)->dst = (int32)GPS_Util_Get_Float(p); + (*way)->dst = GPS_Util_Get_Float(p); p+=sizeof(float); for(i=0;i<2;++i) (*way)->state[i] = *p++; @@ -1309,9 +1310,9 @@ static void GPS_D109_Get(GPS_PWay *way, UC *s, int protoid) (*way)->alt = GPS_Util_Get_Float(p); p+=sizeof(float); - (*way)->dpth = (int32)GPS_Util_Get_Float(p); + (*way)->dpth = GPS_Util_Get_Float(p); p+=sizeof(float); - (*way)->dst = (int32)GPS_Util_Get_Float(p); + (*way)->dst = GPS_Util_Get_Float(p); p+=sizeof(float); for(i=0;i<2;++i) (*way)->state[i] = *p++; @@ -1604,7 +1605,6 @@ static void GPS_D155_Get(GPS_PWay *way, UC *s) static void GPS_D100_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1636,7 +1636,6 @@ static void GPS_D100_Send(UC *data, GPS_PWay way, int32 *len) static void GPS_D101_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1674,7 +1673,6 @@ static void GPS_D101_Send(UC *data, GPS_PWay way, int32 *len) static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1690,7 +1688,7 @@ static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Float(p,way->dst); p+= sizeof(float); - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p,(US) way->smbl); *len = 64; @@ -1711,7 +1709,6 @@ static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len) static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1725,8 +1722,8 @@ static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len) p+=sizeof(int32); copy_char_array(&p, way->cmnt, 40, UpperYes); - *p++ = way->smbl; - *p = way->dspl; + *p++ = (UC) way->smbl; + *p = (UC) way->dspl; *len = 60; @@ -1747,7 +1744,6 @@ static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len) static void GPS_D104_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1767,7 +1763,7 @@ static void GPS_D104_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Float(p,way->dst); p+= sizeof(float); - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p, (int16) way->smbl); p+=sizeof(int16); *p = 3; /* display symbol with waypoint name */ @@ -1800,7 +1796,7 @@ static void GPS_D105_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p, (int16) way->smbl); p+=sizeof(int16); q = (UC *) way->wpt_ident; @@ -1838,7 +1834,7 @@ static void GPS_D106_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p, (int16) way->smbl); p+=sizeof(int16); q = (UC *) way->wpt_ident; @@ -1865,7 +1861,6 @@ static void GPS_D106_Send(UC *data, GPS_PWay way, int32 *len) static void GPS_D107_Send(UC *data, GPS_PWay way, int32 *len) { UC *p; - int32 i; p = data; @@ -1916,7 +1911,7 @@ static void GPS_D108_Send(UC *data, GPS_PWay way, int32 *len) *p++ = way->colour; *p++ = way->dspl; *p++ = 0x60; - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p,(US) way->smbl); p+=sizeof(int16); for(i=0;i<18;++i) *p++ = way->subclass[i]; GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat)); @@ -1990,7 +1985,7 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len, int protoid) } else { GPS_Warning("Unknown protoid in GPS_D109_Send."); } - GPS_Util_Put_Short(p,way->smbl); + GPS_Util_Put_Short(p,(US) way->smbl); p+=sizeof(int16); for(i=0;i<18;++i) *p++ = way->subclass[i]; GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat)); @@ -2008,7 +2003,7 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len, int protoid) for(i=0;i<2;++i) *p++ = way->cc[i]; for(i=0;i<4;++i) *p++ = 0xff; /* D109 silliness for ETE */ if (protoid == 110) { - float temp = 1.0e25; + float temp = 1.0e25f; GPS_Util_Put_Float(p, temp); p += 4; @@ -2074,7 +2069,7 @@ static void GPS_D150_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); copy_char_array(&p, way->city, 24, UpperYes); @@ -2121,7 +2116,7 @@ static void GPS_D151_Send(UC *data, GPS_PWay way, int32 *len) copy_char_array(&p, way->city, 24, UpperYes); copy_char_array(&p, way->state, 2, UpperYes); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); for(i=0;i<2;++i) *p++ = way->cc[i]; @@ -2170,7 +2165,7 @@ static void GPS_D152_Send(UC *data, GPS_PWay way, int32 *len) copy_char_array(&p, way->city, 24, UpperYes); copy_char_array(&p, way->state, 2, UpperYes); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); for(i=0;i<2;++i) *p++ = way->cc[i]; @@ -2219,7 +2214,7 @@ static void GPS_D154_Send(UC *data, GPS_PWay way, int32 *len) copy_char_array(&p, way->city, 24, UpperYes); copy_char_array(&p, way->state, 2, UpperYes); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); for(i=0;i<2;++i) *p++ = way->cc[i]; @@ -2270,7 +2265,7 @@ static void GPS_D155_Send(UC *data, GPS_PWay way, int32 *len) copy_char_array(&p, way->city, 24, UpperYes); copy_char_array(&p, way->state, 2, UpperYes); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); for(i=0;i<2;++i) *p++ = way->cc[i]; @@ -2685,7 +2680,7 @@ int32 GPS_A200_Send(const char *port, GPS_PWay *way, int32 n) if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New())) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -2774,7 +2769,7 @@ int32 GPS_A200_Send(const char *port, GPS_PWay *way, int32 n) } - GPS_Make_Packet(&tra, method, data,len); + GPS_Make_Packet(&tra, method, data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -2834,7 +2829,7 @@ int32 GPS_A201_Send(const char *port, GPS_PWay *way, int32 n) if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New())) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -2943,7 +2938,7 @@ int32 GPS_A201_Send(const char *port, GPS_PWay *way, int32 n) } - GPS_Make_Packet(&tra, method, data,len); + GPS_Make_Packet(&tra, method, data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -3175,7 +3170,7 @@ static void GPS_D210_Send(UC *data, GPS_PWay way, int32 *len) p = data; - GPS_Util_Put_Short(p,way->rte_link_class); + GPS_Util_Put_Short(p,(US) way->rte_link_class); p+=sizeof(int16); for(i=0;i<18;++i) *p++ = way->rte_link_subclass[i]; @@ -3458,7 +3453,7 @@ int32 GPS_A300_Send(const char *port, GPS_PTrack *trk, int32 n) if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New())) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -3483,7 +3478,7 @@ int32 GPS_A300_Send(const char *port, GPS_PTrack *trk, int32 n) } GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Trk_Data, - data,len); + data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -3553,7 +3548,7 @@ int32 GPS_A301_Send(const char *port, GPS_PTrack *trk, int32 n) if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New())) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -3604,7 +3599,7 @@ int32 GPS_A301_Send(const char *port, GPS_PTrack *trk, int32 n) } - GPS_Make_Packet(&tra, method, data,len); + GPS_Make_Packet(&tra, method, data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -3834,7 +3829,6 @@ void GPS_D310_Get(GPS_PTrack *trk, UC *s) void GPS_D311_Get(GPS_PTrack *trk, UC *s) { UC *p; - UC *q; short identifier; p=s; @@ -4184,7 +4178,7 @@ int32 GPS_A400_Send(const char *port, GPS_PWay *way, int32 n) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -4248,7 +4242,7 @@ int32 GPS_A400_Send(const char *port, GPS_PWay *way, int32 n) } GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Prx_Wpt_Data, - data,len); + data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -4489,7 +4483,7 @@ static void GPS_D450_Send(UC *data, GPS_PWay way, int32 *len) p = data; - GPS_Util_Put_Short(p,way->idx); + GPS_Util_Put_Short(p,(US) way->idx); p+=sizeof(int16); for(i=0;i<6;++i) *p++ = way->ident[i]; @@ -4501,7 +4495,7 @@ static void GPS_D450_Send(UC *data, GPS_PWay way, int32 *len) GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); - GPS_Util_Put_Short(p,way->alt); + GPS_Util_Put_Short(p,(US) way->alt); p+=sizeof(int16); for(i=0;i<24;++i) *p++ = way->city[i]; @@ -4641,7 +4635,7 @@ int32 GPS_A500_Send(const char *port, GPS_PAlmanac *alm, int32 n) return MEMORY_ERROR; - GPS_Util_Put_Short(data,n); + GPS_Util_Put_Short(data,(US) n); GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records, data,2); if(!GPS_Write_Packet(fd,tra)) @@ -4693,7 +4687,7 @@ int32 GPS_A500_Send(const char *port, GPS_PAlmanac *alm, int32 n) } GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Almanac_Data, - data,len); + data,(US) len); if(!GPS_Write_Packet(fd,tra)) return gps_errno; @@ -5385,9 +5379,9 @@ void GPS_D600_Send(GPS_PPacket *packet, time_t Time) *p++ = ts->tm_mon+1; *p++ = ts->tm_mday; - GPS_Util_Put_Short(p,ts->tm_year+1900); + GPS_Util_Put_Short(p,(US) (ts->tm_year+1900)); p+=2; - GPS_Util_Put_Short(p,ts->tm_hour); + GPS_Util_Put_Short(p,(US) ts->tm_hour); p+=2; *p++ = ts->tm_min; diff --git a/gpsbabel/jeeps/gpscom.c b/gpsbabel/jeeps/gpscom.c index 9cfca0331..b3d6b3e05 100644 --- a/gpsbabel/jeeps/gpscom.c +++ b/gpsbabel/jeeps/gpscom.c @@ -84,7 +84,7 @@ int32 GPS_Command_Off(const char *port) ** @return [int32] number of waypoint entries ************************************************************************/ -int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)()) +int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)(int, struct GPS_SWay **)) { int32 ret=0; @@ -114,7 +114,7 @@ int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)()) ** @return [int32] success ************************************************************************/ -int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)()) +int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **)) { int32 ret=0; diff --git a/gpsbabel/jeeps/gpscom.h b/gpsbabel/jeeps/gpscom.h index 0d8415736..e8bbe1d2a 100644 --- a/gpsbabel/jeeps/gpscom.h +++ b/gpsbabel/jeeps/gpscom.h @@ -28,8 +28,8 @@ int32 GPS_Command_Send_Almanac(const char *port, GPS_PAlmanac *alm, int32 n); int32 GPS_Command_Get_Track(const char *port, GPS_PTrack **trk); int32 GPS_Command_Send_Track(const char *port, GPS_PTrack *trk, int32 n); -int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)()); -int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)()); +int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)(int, struct GPS_SWay **)); +int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **)); int32 GPS_Command_Get_Proximity(const char *port, GPS_PWay **way); int32 GPS_Command_Send_Proximity(const char *port, GPS_PWay *way, int32 n); diff --git a/gpsbabel/jeeps/gpsprot.h b/gpsbabel/jeeps/gpsprot.h index 4fe5caa14..6a9e75bc1 100644 --- a/gpsbabel/jeeps/gpsprot.h +++ b/gpsbabel/jeeps/gpsprot.h @@ -247,7 +247,7 @@ int32 gps_link_type; struct GPS_MODEL_PROTOCOL { - int32 id; + US id; int32 link; int32 command; int32 wayptt; diff --git a/gpsbabel/jeeps/gpsread.c b/gpsbabel/jeeps/gpsread.c index d37fe6f3e..2d2f2d153 100644 --- a/gpsbabel/jeeps/gpsread.c +++ b/gpsbabel/jeeps/gpsread.c @@ -22,6 +22,7 @@ ** Boston, MA 02111-1307, USA. ********************************************************************/ #include "gps.h" +#include "gpsusbint.h" #include #include #include diff --git a/gpsbabel/jeeps/gpsread.h b/gpsbabel/jeeps/gpsread.h index 138cc5866..5abd56cfa 100644 --- a/gpsbabel/jeeps/gpsread.h +++ b/gpsbabel/jeeps/gpsread.h @@ -12,6 +12,7 @@ extern "C" time_t GPS_Time_Now(void); int32 GPS_Packet_Read(int32 fd, GPS_PPacket *packet); +int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet); int32 GPS_Get_Ack(int32 fd, GPS_PPacket *tra, GPS_PPacket *rec); int32 ajb(int32 fd); diff --git a/gpsbabel/jeeps/gpssend.c b/gpsbabel/jeeps/gpssend.c index c4b299d7a..b32ba2a27 100644 --- a/gpsbabel/jeeps/gpssend.c +++ b/gpsbabel/jeeps/gpssend.c @@ -22,8 +22,11 @@ ** Boston, MA 02111-1307, USA. ********************************************************************/ #include "gps.h" +#include "gpsusbint.h" + #include #include +#include /* @func GPS_Make_Packet *********************************************** @@ -58,7 +61,7 @@ void GPS_Make_Packet(GPS_PPacket *packet, UC type, UC *data, int16 n) (*packet)->dle = DLE; (*packet)->edle = DLE; (*packet)->etx = ETX; - (*packet)->n = n; + (*packet)->n = (UC) n; (*packet)->type = type; (*packet)->bytes = 0; diff --git a/gpsbabel/jeeps/gpsserial.c b/gpsbabel/jeeps/gpsserial.c index 68b97a9da..9e8eb41ad 100644 --- a/gpsbabel/jeeps/gpsserial.c +++ b/gpsbabel/jeeps/gpsserial.c @@ -23,6 +23,7 @@ ** Boston, MA 02111-1307, USA. ********************************************************************/ #include "gps.h" +#include "garminusb.h" #include #include #include @@ -208,7 +209,7 @@ int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size) return 0; } WriteFile (comport, obuf, size, &len, NULL); - if (len != size) { + if (len != (DWORD) size) { fatal ("Write error. Wrote %d of %d bytes.", len, size); } return len; diff --git a/gpsbabel/jeeps/gpsserial.h b/gpsbabel/jeeps/gpsserial.h index 1849cd01c..7d3958d48 100644 --- a/gpsbabel/jeeps/gpsserial.h +++ b/gpsbabel/jeeps/gpsserial.h @@ -24,6 +24,7 @@ int32 GPS_Serial_Flush(int32 fd); int32 GPS_Serial_On_NMEA(const char *port, int32 *fd); int32 GPS_Serial_Read(int32 ignored, void *ibuf, int size); int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size); +void GPS_Serial_Error(char *hdr); #endif diff --git a/gpsbabel/jeeps/gpsusbread.c b/gpsbabel/jeeps/gpsusbread.c index edcabf6ab..cff319a23 100644 --- a/gpsbabel/jeeps/gpsusbread.c +++ b/gpsbabel/jeeps/gpsusbread.c @@ -21,6 +21,7 @@ #include #include "gps.h" #include "garminusb.h" +#include "gpsusbint.h" int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet) { @@ -54,7 +55,7 @@ int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet) */ (*packet)->type = le_read16(&pkt.gusb_pkt.pkt_id); payload_size = le_read32(&pkt.gusb_pkt.datasz); - (*packet)->n = payload_size; + (*packet)->n = (UC) payload_size; memcpy((*packet)->data, &pkt.gusb_pkt.databuf, payload_size); return payload_size; } diff --git a/gpsbabel/jeeps/gpsusbsend.c b/gpsbabel/jeeps/gpsusbsend.c index a6af171f3..8e0877a45 100644 --- a/gpsbabel/jeeps/gpsusbsend.c +++ b/gpsbabel/jeeps/gpsusbsend.c @@ -23,6 +23,7 @@ #include #include #include "garminusb.h" +#include "gpsusbint.h" void GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n) @@ -36,7 +37,7 @@ GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n) (*packet)->type = type; memcpy((*packet)->data, data, n); - (*packet)->n = n; + (*packet)->n = (UC) n; return; } @@ -44,8 +45,6 @@ GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n) int32 GPS_Write_Packet_usb(int32 fd, GPS_PPacket packet) { - size_t ret, sz; - garmin_usb_packet gp = {0}; diff --git a/gpsbabel/jeeps/gpsusbwin.c b/gpsbabel/jeeps/gpsusbwin.c index c841351c4..44f15ddda 100644 --- a/gpsbabel/jeeps/gpsusbwin.c +++ b/gpsbabel/jeeps/gpsusbwin.c @@ -83,7 +83,7 @@ gusb_open(const char *pname) // } } - hdevinfo = SetupDiGetClassDevs( &GARMIN_GUID, NULL, NULL, + hdevinfo = SetupDiGetClassDevs( (GUID *) &GARMIN_GUID, NULL, NULL, DIGCF_PRESENT|DIGCF_INTERFACEDEVICE); if (hdevinfo == INVALID_HANDLE_VALUE) { @@ -93,7 +93,7 @@ gusb_open(const char *pname) /* Get the device associated with this index. */ devinterface.cbSize = sizeof(SP_INTERFACE_DEVICE_DATA); - if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, &GARMIN_GUID, + if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, (GUID *) &GARMIN_GUID, 0, &devinterface)) { GPS_Serial_Error("SetupDiEnumDeviceInterfaces"); warning("Is the unit powered up and connected?"); @@ -173,13 +173,14 @@ gusb_close(const char *portname) usb_handle = INVALID_HANDLE_VALUE; #endif } + return 0; } int gusb_cmd_get(garmin_usb_packet *ibuf, size_t sz) { DWORD rxed = GARMIN_USB_INTERRUPT_DATA_SIZE; - unsigned char *buf = &ibuf->dbuf; + unsigned char *buf = (unsigned char *) &ibuf->dbuf; int i; int tsz=0; unsigned char *obuf = buf; @@ -194,7 +195,7 @@ gusb_cmd_get(garmin_usb_packet *ibuf, size_t sz) fatal("ioctl"); } buf += rxed; - sz =- rxed; + sz -= rxed; tsz += rxed; if (rxed < GARMIN_USB_INTERRUPT_DATA_SIZE) { break; @@ -221,7 +222,7 @@ gusb_cmd_send(const garmin_usb_packet *opkt, size_t sz) { DWORD rsz; size_t i; - unsigned char *obuf = &opkt->dbuf; + unsigned char *obuf = (unsigned char *) &opkt->dbuf; const char *m1, *m2; /* The spec warns us about making writes an exact multiple @@ -255,7 +256,7 @@ gusb_cmd_send(const garmin_usb_packet *opkt, size_t sz) static char * id_unit(void) { -static const char oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0}; +static const unsigned char oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0}; /* * Identify the unit before getting into all the protocol gunk. * We get two packets back, but we discard the protocol array diff --git a/gpsbabel/kml.c b/gpsbabel/kml.c index 1a216ecce..0877936ce 100644 --- a/gpsbabel/kml.c +++ b/gpsbabel/kml.c @@ -148,7 +148,6 @@ kml_wr_deinit(void) static void kml_waypt_pr(const waypoint *waypointp) { - char *odesc; fputs(" \n", ofd); // write_optional_xml_entity(ofd, "\t", "name", waypointp->shortname); write_optional_xml_entity(ofd, "\t", "name", waypointp->description); diff --git a/gpsbabel/magnav.c b/gpsbabel/magnav.c index c33425953..ef9020bfa 100644 --- a/gpsbabel/magnav.c +++ b/gpsbabel/magnav.c @@ -179,7 +179,7 @@ my_writewpt(const waypoint *wpt) be_write32(&rec->longitude, si_round(wpt->longitude * 100000.0)); be_write32(&rec->latitude, si_round(wpt->latitude * 100000.0)); - be_write32(&rec->elevation, wpt->altitude); + be_write32(&rec->elevation, (unsigned int) (wpt->altitude)); rec->plot = 0; rec->unknown3 = 'a'; @@ -205,7 +205,7 @@ my_writewpt(const waypoint *wpt) vdata[1] = '\0'; vdata += 2; - opdb_rec = new_Record (0, 0, ct++, vdata-(char *)rec, (const ubyte *)rec); + opdb_rec = new_Record (0, 0, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index b1bc1ef6a..4666d2c5b 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -617,7 +617,7 @@ termwrite(char *obuf, int size) return; } WriteFile (comport, obuf, size, &len, NULL); - if (len != size) { + if ((int) len != size) { fatal(MYNAME ":. Wrote %d of %d bytes.\n", len, size); } } diff --git a/gpsbabel/mapopolis.c b/gpsbabel/mapopolis.c index d89b0baab..6d632831d 100644 --- a/gpsbabel/mapopolis.c +++ b/gpsbabel/mapopolis.c @@ -149,7 +149,7 @@ decode(char *buf) // for(pdb_rec = pdb->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) { for(pdb_rec=pdb_rec->next; pdb_rec; pdb_rec=pdb_rec->next) { waypoint *wpt_tmp; - char *vdata; + char *vdata = 0; char *edata; struct tm tm = {0}; @@ -266,8 +266,6 @@ my_writewpt(const waypoint *wpt) static void data_write(void) { - queue *elem, *tmp; - static char *appinfo = "\0\x01" "User\0\0\0\0\0\0\0\0\0\0\0\0" diff --git a/gpsbabel/mapsend.c b/gpsbabel/mapsend.c index 1bf106af7..b5c2879a9 100644 --- a/gpsbabel/mapsend.c +++ b/gpsbabel/mapsend.c @@ -544,7 +544,7 @@ void mapsend_track_disp(const waypoint * wpt) my_fwrite8(&dbl, mapsend_file_out); /* altitude */ - i = wpt->altitude; + i = (int) wpt->altitude; my_fwrite4(&i, mapsend_file_out); /* time */ diff --git a/gpsbabel/mapsource.c b/gpsbabel/mapsource.c index 83871c700..948d76084 100644 --- a/gpsbabel/mapsource.c +++ b/gpsbabel/mapsource.c @@ -413,7 +413,7 @@ mps_fileHeader_r(FILE *mps_file, int *mps_ver) static void mps_fileHeader_w(FILE *mps_file, int mps_ver) { - char hdr[100]; + unsigned char hdr[100]; int reclen; strcpy (hdr, "MsRc"); @@ -469,10 +469,10 @@ mps_fileHeader_w(FILE *mps_file, int mps_ver) static void mps_mapsegment_r(FILE *mps_file, int mps_ver) { - char hdr[100]; int reclen; /* At the moment we're not doing anything with map segments, but here's the template code as if we were + char hdr[100]; fread(&CDid, 4, 1, mps_file); reclen = le_read32(&CDid); @@ -501,10 +501,10 @@ mps_mapsegment_r(FILE *mps_file, int mps_ver) static void mps_mapsetname_r(FILE *mps_file, int mps_ver) { - char hdr[100]; int reclen; /* At the moment we're not doing anything with mapsetnames, but here's the template code as if we were + char hdr[100]; mps_readstr(mps_file, hdr, sizeof(hdr)); char mapsetnamename[very large number?]; strcpy(mapsetnamename,hdr); @@ -859,7 +859,7 @@ mps_route_wpt_w_unique_wrapper(const waypoint *wpt) } } } - +#if 0 /* * wrapper to include the mps_ver_out information * This one always writes a waypoint. If it has been written before @@ -871,7 +871,6 @@ mps_waypoint_w_uniqloc_wrapper(waypoint *wpt) { waypoint *wptfound = NULL; char *newName; - unsigned int uniqueNum = 0; /* Search for this waypoint in the ones already written */ wptfound = mps_find_wpt_q_by_name(&written_wpt_head, wpt->shortname); @@ -903,6 +902,7 @@ mps_waypoint_w_uniqloc_wrapper(waypoint *wpt) mps_wpt_q_add(&written_wpt_head, wpt); } } +#endif /* * read in from file a route record @@ -920,9 +920,7 @@ mps_route_r(FILE *mps_file, int mps_ver, route_head **rte) int interlinkStepCount; int thisInterlinkStep; unsigned int mpsclass; - int FFsRead; - time_t dateTime = 0; route_head *rte_head; int rte_count; @@ -1179,7 +1177,6 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte) { unsigned int reclen; unsigned int rte_datapoints; - unsigned int colour = 0; /* unknown colour */ int rname_len; char *rname; char hdr[20]; @@ -1319,7 +1316,6 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte) fwrite(zbuf, 9, 1, mps_file); } else { - unsigned char cbuf[8]; hdr[0] = 1; fwrite(hdr, 1 , 1, mps_file); @@ -1348,7 +1344,6 @@ mps_routedatapoint_w(FILE *mps_file, int mps_ver, const waypoint *rtewpt) unsigned char hdr[10]; int lat; int lon; - time_t t = rtewpt->creation_time; char zbuf[20]; char ffbuf[20]; char *src; diff --git a/gpsbabel/msvc/GPSBabel.dsp b/gpsbabel/msvc/GPSBabel.dsp index 36474f1d1..45f765dee 100644 --- a/gpsbabel/msvc/GPSBabel.dsp +++ b/gpsbabel/msvc/GPSBabel.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c +# ADD CPP /nologo /W3 /WX /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,8 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c -# SUBTRACT CPP /WX +# ADD CPP /nologo /W3 /WX /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/gpsbabel/msvc/GPSBabel.vcproj b/gpsbabel/msvc/GPSBabel.vcproj index 9ec42e4ea..9c21dd333 100644 --- a/gpsbabel/msvc/GPSBabel.vcproj +++ b/gpsbabel/msvc/GPSBabel.vcproj @@ -33,6 +33,7 @@ ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" + WarnAsError="TRUE" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> @@ -40,6 +41,7 @@ Name="VCCustomBuildTool"/> diff --git a/gpsbabel/nmea.c b/gpsbabel/nmea.c index c5bba8ecb..0a6fd3d68 100644 --- a/gpsbabel/nmea.c +++ b/gpsbabel/nmea.c @@ -439,7 +439,7 @@ nmea_trackpt_pr(const waypoint *wpt) } static void -nmea_write() +nmea_write(void) { waypt_disp_all(nmea_wayptpr); track_disp_all(NULL, NULL, nmea_trackpt_pr); diff --git a/gpsbabel/palmdoc.c b/gpsbabel/palmdoc.c index 32344c821..ba4e2d5cc 100644 --- a/gpsbabel/palmdoc.c +++ b/gpsbabel/palmdoc.c @@ -256,7 +256,8 @@ static void write_header( void ) { --recs; } - opdb_rec = new_Record (0, 0, 0, sizeof(struct doc_record0)+sizeof(short)*(ct-1), (const ubyte *)rec0); + opdb_rec = new_Record (0, 0, 0, + (uword) (sizeof(struct doc_record0)+sizeof(short)*(ct-1)), (const ubyte *)rec0); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create summary record\n"); @@ -316,7 +317,7 @@ static void commit_buffer( void ) { compress( &buf ); - opdb_rec = new_Record (0, 0, ct++, buf.len, (const ubyte *)buf.data); + opdb_rec = new_Record (0, 0, ct++, (uword) buf.len, (const ubyte *)buf.data); if (opdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); @@ -436,8 +437,8 @@ palmdoc_disp(const waypoint *wpt) bm = xstrdup(bookmarktext); create_bookmark(bm); - lonint = abs(wpt->longitude); - latint = abs(wpt->latitude); + lonint = abs((int) wpt->longitude); + latint = abs((int) wpt->latitude); GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, &utme, &utmn, &utmz, &utmzc); diff --git a/gpsbabel/position.c b/gpsbabel/position.c index dbf54cd57..49a79929b 100644 --- a/gpsbabel/position.c +++ b/gpsbabel/position.c @@ -230,7 +230,7 @@ position_noop_t(const route_head *h) { } -void position_process() +void position_process(void) { int i = waypt_count(); diff --git a/gpsbabel/psitrex.c b/gpsbabel/psitrex.c index 3be021c4c..89ab8dd9a 100755 --- a/gpsbabel/psitrex.c +++ b/gpsbabel/psitrex.c @@ -208,7 +208,6 @@ static void psit_getToken(FILE *psit_file, char *buf, size_t sz, psit_tokenSep_type delimType) { int c; -char *buf2 = buf; /* MRCB debug */ *buf = 0; @@ -285,8 +284,6 @@ psit_waypoint_r(FILE *psit_file, waypoint **wpt) int garmin_icon_num; waypoint *thisWaypoint; - double psit_altitude = unknown_alt; - double psit_depth = unknown_alt; if (strlen(psit_current_token) > 0) { thisWaypoint = waypt_new(); @@ -331,10 +328,8 @@ static void psit_waypoint_w(FILE *psit_file, const waypoint *wpt) { int icon; - char *src; - const char *ident; - int display = 1; - int colour = 0; /* (unknown colour) black is 1, white is 16 */ + const char *ident; + char *src = 0; /* BUGBUG Passed to mkshort */ fprintf(psit_file, "%11.6f,%11.6f,", wpt->latitude, @@ -383,13 +378,10 @@ psit_route_r(FILE *psit_file, route_head **rte) int garmin_icon_num; - time_t dateTime = 0; route_head *rte_head; unsigned int rte_count; waypoint *thisWaypoint; - double psit_altitude = unknown_alt; - double psit_depth = unknown_alt; psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL); @@ -525,8 +517,6 @@ psit_track_r(FILE *psit_file, route_head **trk) unsigned int trk_count; waypoint *thisWaypoint; - double psit_altitude = unknown_alt; - double psit_depth = unknown_alt; psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL); if (strlen(psit_current_token) == 0) { @@ -676,10 +666,6 @@ psit_trackdatapoint_w(FILE *psit_file, const waypoint *wpt) time_t t = wpt->creation_time; struct tm *tmTime = gmtime(&t); - double psit_altitude = wpt->altitude; - double psit_proximity = unknown_alt; - double psit_depth = unknown_alt; - fprintf(psit_file, "%11.6f,%11.6f,", wpt->latitude, wpt->longitude); diff --git a/gpsbabel/quovadis.c b/gpsbabel/quovadis.c index 164e7307c..e71eda892 100644 --- a/gpsbabel/quovadis.c +++ b/gpsbabel/quovadis.c @@ -173,9 +173,9 @@ quovadis_writewpt(waypoint *wpt) rec = (struct record *) xcalloc(sizeof(*rec),1); - be_write32(&rec->longitude, (wpt->longitude + - 180.0) * 1000000.0); - be_write32(&rec->latitude, (90.0 - wpt->latitude) * 1000000.0); + be_write32(&rec->longitude, (unsigned int) ((wpt->longitude + + 180.0) * 1000000.0)); + be_write32(&rec->latitude, (unsigned int) ((90.0 - wpt->latitude) * 1000000.0)); if ( wpt->shortname ) { strncpy(rec->name, wpt->shortname, 32 ); rec->name[31] = '\0'; @@ -265,8 +265,8 @@ data_write(void) if (rec_index != 0) { struct pdb_record* pdb_rec; - pdb_rec = new_Record(0, 0, ct++, rec_index * - sizeof(struct record), current_rec); + pdb_rec = new_Record(0, 0, ct++, (uword) (rec_index * + sizeof(struct record)), current_rec); if (pdb_rec == NULL) { fatal(MYNAME ": libpdb couldn't create record\n"); diff --git a/gpsbabel/shape.c b/gpsbabel/shape.c index 4294e8172..cd51d232e 100644 --- a/gpsbabel/shape.c +++ b/gpsbabel/shape.c @@ -37,8 +37,6 @@ static int nameidx; static void my_rd_init(const char *fname) { - int i; - ihandle = SHPOpen(fname, "rb" ); if (ihandle == NULL) { fatal(MYNAME ":Cannot open shp file %s for reading\n", fname); diff --git a/gpsbabel/stackfilter.c b/gpsbabel/stackfilter.c index c8c5021fb..494947042 100644 --- a/gpsbabel/stackfilter.c +++ b/gpsbabel/stackfilter.c @@ -74,7 +74,6 @@ stackfilt_process(void) queue *elem = NULL; queue *tmp = NULL; queue tmp_queue; - waypoint *wpt_tmp; unsigned int tmp_count; if ( opt_push ) { diff --git a/gpsbabel/text.c b/gpsbabel/text.c index 4bd5f5565..82698c28c 100644 --- a/gpsbabel/text.c +++ b/gpsbabel/text.c @@ -71,8 +71,8 @@ text_disp(const waypoint *wpt) double utme, utmn; char utmzc; - lonint = abs(wpt->longitude); - latint = abs(wpt->latitude); + lonint = abs((int) wpt->longitude); + latint = abs((int) wpt->latitude); GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, &utme, &utmn, &utmz, &utmzc); diff --git a/gpsbabel/tools/mkchanges b/gpsbabel/tools/mkchanges index ed3b9ec5f..5df969a82 100644 --- a/gpsbabel/tools/mkchanges +++ b/gpsbabel/tools/mkchanges @@ -1,3 +1,4 @@ +# cvsps -u cvsps $* | awk ' /^Date:/ { logt = ""; diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 165453a3e..ae4453d0f 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -497,8 +497,6 @@ get_tz_offset(void) time_t current_time(void) { - static char *frozen; - if (getenv("GPSBABEL_FREEZE_TIME")) { return 0; } @@ -917,7 +915,6 @@ strip_nastyhtml(const char * in) { char *returnstr, *sp; char *lcstr, *lcp; - int i; sp = returnstr = xstrdup(in); lcp = lcstr = xstrdup(in); diff --git a/gpsbabel/uuid.c b/gpsbabel/uuid.c index 3f6fc01a2..97b631476 100755 --- a/gpsbabel/uuid.c +++ b/gpsbabel/uuid.c @@ -18,17 +18,7 @@ */ #include "uuid.h" - -static unsigned char -random() -{ - if (getenv("GPSBABEL_FREEZE_TIME")) { - static unsigned char blech = 0; - return blech++; - } else - return ; -} - +#include void uuid_generate(uuid_t uu) diff --git a/gpsbabel/vcf.c b/gpsbabel/vcf.c index 2ffbc79a9..64fb45cc1 100644 --- a/gpsbabel/vcf.c +++ b/gpsbabel/vcf.c @@ -89,14 +89,9 @@ static void vcf_disp(const waypoint *wpt) { int latint, lonint; - char tbuf[1024]; - time_t tm = wpt->creation_time; - long utmz; - double utme, utmn; - char utmzc; - lonint = abs(wpt->longitude); - latint = abs(wpt->latitude); + lonint = abs((int) wpt->longitude); + latint = abs((int) wpt->latitude); fprintf(file_out, "BEGIN:VCARD\nVERSION:3.0\n"); fprintf(file_out, "N:%s;%s;;;\n", wpt->description,wpt->shortname); -- 2.30.2